/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.buanalintas.sandals.pos.entities;

import com.buanalintas.bynga.entities.MasterUnit;
import com.buanalintas.bynga.entities.MasterUser;
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Joekrisbel
 */
@Entity
@Table(name = "pos_transaction_payment")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PosTransactionPayment.findAll", query = "SELECT p FROM PosTransactionPayment p"),
    @NamedQuery(name = "PosTransactionPayment.findBySync", query = "SELECT p FROM PosTransactionPayment p WHERE p.sync = :sync"),
    @NamedQuery(name = "PosTransactionPayment.findByPaymentId", query = "SELECT p FROM PosTransactionPayment p WHERE p.paymentId = :paymentId"),
    @NamedQuery(name = "PosTransactionPayment.findByPaymentDate", query = "SELECT p FROM PosTransactionPayment p WHERE p.paymentDate = :paymentDate"),
    @NamedQuery(name = "PosTransactionPayment.findByPaymentFirstGiroDate", query = "SELECT p FROM PosTransactionPayment p WHERE p.paymentFirstGiroDate = :paymentFirstGiroDate"),
    @NamedQuery(name = "PosTransactionPayment.findByPaymentFirstGiroNominal", query = "SELECT p FROM PosTransactionPayment p WHERE p.paymentFirstGiroNominal = :paymentFirstGiroNominal"),
    @NamedQuery(name = "PosTransactionPayment.findByPaymentSecondGiroDate", query = "SELECT p FROM PosTransactionPayment p WHERE p.paymentSecondGiroDate = :paymentSecondGiroDate"),
    @NamedQuery(name = "PosTransactionPayment.findByPaymentSecondGiroNominal", query = "SELECT p FROM PosTransactionPayment p WHERE p.paymentSecondGiroNominal = :paymentSecondGiroNominal"),
    @NamedQuery(name = "PosTransactionPayment.findByPaymentTriedGiroDate", query = "SELECT p FROM PosTransactionPayment p WHERE p.paymentTriedGiroDate = :paymentTriedGiroDate"),
    @NamedQuery(name = "PosTransactionPayment.findByPaymentTriedGiroNominal", query = "SELECT p FROM PosTransactionPayment p WHERE p.paymentTriedGiroNominal = :paymentTriedGiroNominal"),
    @NamedQuery(name = "PosTransactionPayment.findByPaymentFourGiroDate", query = "SELECT p FROM PosTransactionPayment p WHERE p.paymentFourGiroDate = :paymentFourGiroDate"),
    @NamedQuery(name = "PosTransactionPayment.findByPaymentFourGiroNominal", query = "SELECT p FROM PosTransactionPayment p WHERE p.paymentFourGiroNominal = :paymentFourGiroNominal"),
    @NamedQuery(name = "PosTransactionPayment.findByPaymentFiveGiroDate", query = "SELECT p FROM PosTransactionPayment p WHERE p.paymentFiveGiroDate = :paymentFiveGiroDate"),
    @NamedQuery(name = "PosTransactionPayment.findByPaymentFiveGiroNominal", query = "SELECT p FROM PosTransactionPayment p WHERE p.paymentFiveGiroNominal = :paymentFiveGiroNominal"),
    @NamedQuery(name = "PosTransactionPayment.findByPaymentTotal", query = "SELECT p FROM PosTransactionPayment p WHERE p.paymentTotal = :paymentTotal"),
    @NamedQuery(name = "PosTransactionPayment.findByPaymentKeel", query = "SELECT p FROM PosTransactionPayment p WHERE p.paymentKeel = :paymentKeel"),
    @NamedQuery(name = "PosTransactionPayment.findByPaymentCash", query = "SELECT p FROM PosTransactionPayment p WHERE p.paymentCash = :paymentCash"),
    @NamedQuery(name = "PosTransactionPayment.findByPaymentStage", query = "SELECT p FROM PosTransactionPayment p WHERE p.paymentStage = :paymentStage"),
    @NamedQuery(name = "PosTransactionPayment.findByPaymentTimestamp", query = "SELECT p FROM PosTransactionPayment p WHERE p.paymentTimestamp = :paymentTimestamp")})
public class PosTransactionPayment implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "payment_id")
    private Integer paymentId;
    @Column(name = "payment_date")
    @Temporal(TemporalType.DATE)
    private Date paymentDate;
    @Column(name = "payment_first_giro_date")
    @Temporal(TemporalType.DATE)
    private Date paymentFirstGiroDate;
    @Column(name = "payment_first_giro_nominal")
    private BigDecimal paymentFirstGiroNominal;
    @Column(name = "payment_second_giro_date")
    @Temporal(TemporalType.DATE)
    private Date paymentSecondGiroDate;
    @Column(name = "payment_second_giro_nominal")
    private BigDecimal paymentSecondGiroNominal;
    @Column(name = "payment_tried_giro_date")
    @Temporal(TemporalType.DATE)
    private Date paymentTriedGiroDate;
    @Column(name = "payment_tried_giro_nominal")
    private BigDecimal paymentTriedGiroNominal;
    @Column(name = "payment_four_giro_date")
    @Temporal(TemporalType.DATE)
    private Date paymentFourGiroDate;
    @Column(name = "payment_four_giro_nominal")
    private BigDecimal paymentFourGiroNominal;
    @Column(name = "payment_five_giro_date")
    @Temporal(TemporalType.DATE)
    private Date paymentFiveGiroDate;
    @Column(name = "payment_five_giro_nominal")
    private BigDecimal paymentFiveGiroNominal;
    @Column(name = "payment_total")
    private BigDecimal paymentTotal;
    @Column(name = "payment_keel")
    private String paymentKeel;
    @Column(name = "payment_cash")
    private BigDecimal paymentCash;
    @Column(name = "payment_stage")
    private String paymentStage;
    @Column(name = "payment_timestamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date paymentTimestamp;
    @Lob
    @Column(name = "payment_description")
    private String paymentDescription;

    @JoinColumn(name = "payment_user_id", referencedColumnName = "user_id")
    @ManyToOne
    private MasterUser paymentUserId;
    @JoinColumn(name = "payment_unit_id", referencedColumnName = "unit_id")
    @ManyToOne
    private MasterUnit paymentUnitId;
    @JoinColumn(name = "payment_receipt_id", referencedColumnName = "receipt_id")
    @ManyToOne
    private PosTransactionReceipt paymentReceiptId;
    
    public PosTransactionPayment() {
    }

    public PosTransactionPayment(Integer paymentId) {
        this.paymentId = paymentId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getPaymentId() {
        return paymentId;
    }

    public void setPaymentId(Integer paymentId) {
        this.paymentId = paymentId;
    }

    public Date getPaymentDate() {
        return paymentDate;
    }

    public void setPaymentDate(Date paymentDate) {
        this.paymentDate = paymentDate;
    }

    public Date getPaymentFirstGiroDate() {
        return paymentFirstGiroDate;
    }

    public void setPaymentFirstGiroDate(Date paymentFirstGiroDate) {
        this.paymentFirstGiroDate = paymentFirstGiroDate;
    }

    public BigDecimal getPaymentFirstGiroNominal() {
        return paymentFirstGiroNominal;
    }

    public void setPaymentFirstGiroNominal(BigDecimal paymentFirstGiroNominal) {
        this.paymentFirstGiroNominal = paymentFirstGiroNominal;
    }

    public Date getPaymentSecondGiroDate() {
        return paymentSecondGiroDate;
    }

    public void setPaymentSecondGiroDate(Date paymentSecondGiroDate) {
        this.paymentSecondGiroDate = paymentSecondGiroDate;
    }

    public BigDecimal getPaymentSecondGiroNominal() {
        return paymentSecondGiroNominal;
    }

    public void setPaymentSecondGiroNominal(BigDecimal paymentSecondGiroNominal) {
        this.paymentSecondGiroNominal = paymentSecondGiroNominal;
    }

    public Date getPaymentTriedGiroDate() {
        return paymentTriedGiroDate;
    }

    public void setPaymentTriedGiroDate(Date paymentTriedGiroDate) {
        this.paymentTriedGiroDate = paymentTriedGiroDate;
    }

    public BigDecimal getPaymentTriedGiroNominal() {
        return paymentTriedGiroNominal;
    }

    public void setPaymentTriedGiroNominal(BigDecimal paymentTriedGiroNominal) {
        this.paymentTriedGiroNominal = paymentTriedGiroNominal;
    }

    public Date getPaymentFourGiroDate() {
        return paymentFourGiroDate;
    }

    public void setPaymentFourGiroDate(Date paymentFourGiroDate) {
        this.paymentFourGiroDate = paymentFourGiroDate;
    }

    public BigDecimal getPaymentFourGiroNominal() {
        return paymentFourGiroNominal;
    }

    public void setPaymentFourGiroNominal(BigDecimal paymentFourGiroNominal) {
        this.paymentFourGiroNominal = paymentFourGiroNominal;
    }

    public Date getPaymentFiveGiroDate() {
        return paymentFiveGiroDate;
    }

    public void setPaymentFiveGiroDate(Date paymentFiveGiroDate) {
        this.paymentFiveGiroDate = paymentFiveGiroDate;
    }

    public BigDecimal getPaymentFiveGiroNominal() {
        return paymentFiveGiroNominal;
    }

    public void setPaymentFiveGiroNominal(BigDecimal paymentFiveGiroNominal) {
        this.paymentFiveGiroNominal = paymentFiveGiroNominal;
    }

    public BigDecimal getPaymentTotal() {
        return paymentTotal;
    }

    public void setPaymentTotal(BigDecimal paymentTotal) {
        this.paymentTotal = paymentTotal;
    }

    public String getPaymentKeel() {
        return paymentKeel;
    }

    public void setPaymentKeel(String paymentKeel) {
        this.paymentKeel = paymentKeel;
    }

    public BigDecimal getPaymentCash() {
        return paymentCash;
    }

    public void setPaymentCash(BigDecimal paymentCash) {
        this.paymentCash = paymentCash;
    }

    public String getPaymentStage() {
        return paymentStage;
    }

    public void setPaymentStage(String paymentStage) {
        this.paymentStage = paymentStage;
    }

    public Date getPaymentTimestamp() {
        return paymentTimestamp;
    }

    public void setPaymentTimestamp(Date paymentTimestamp) {
        this.paymentTimestamp = paymentTimestamp;
    }

    public String getPaymentDescription() {
        return paymentDescription;
    }

    public void setPaymentDescription(String paymentDescription) {
        this.paymentDescription = paymentDescription;
    }

    public MasterUser getPaymentUserId() {
        return paymentUserId;
    }

    public void setPaymentUserId(MasterUser paymentUserId) {
        this.paymentUserId = paymentUserId;
    }

    public MasterUnit getPaymentUnitId() {
        return paymentUnitId;
    }

    public void setPaymentUnitId(MasterUnit paymentUnitId) {
        this.paymentUnitId = paymentUnitId;
    }

    public PosTransactionReceipt getPaymentReceiptId() {
        return paymentReceiptId;
    }

    public void setPaymentReceiptId(PosTransactionReceipt paymentReceiptId) {
        this.paymentReceiptId = paymentReceiptId;
    }

    
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (paymentId != null ? paymentId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosTransactionPayment)) {
            return false;
        }
        PosTransactionPayment other = (PosTransactionPayment) object;
        if ((this.paymentId == null && other.paymentId != null) || (this.paymentId != null && !this.paymentId.equals(other.paymentId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.buanalintas.sandals.pos.entities.PosTransactionPayment[ paymentId=" + paymentId + " ]";
    }
    
}
